<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>商品管理</title>
	<link rel="stylesheet" href="/Shopping/Public/Css/admin.css"/>
</head>
<body>
	<div id="header">
		<div class="top">
			<ul>
				<li><a href="<?php echo U('Login/loginOut');?>">❤退出❤</a></li>
				<li style="">欢迎您!<?php echo ($_SESSION['admin']['username']); ?></li>
			</ul>
		</div>
		<div class="h_main">
			<span>购物商城后台管理系统</span>
		</div>
	</div>
	<div id="middle"></div>
	<div class="main mt">
		<div class="m_left fl">
			<ul>
				<a href="<?php echo U('Goods/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>商品管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Cate/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>分类管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('User/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>用户管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Order/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>订单管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Comments/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>评论管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
				<a href="<?php echo U('Adver/index');?>">
					<li>
					<span class="left_ico"></span>
					<b>广告管理</b>
					<span class="right_ico"></span>
					</li>
				</a>
			</ul>
		</div>
	<div class="m_right fr">
		<div class="mright_m">
		
	<div class="agoods_nav">
		<span>商品列表</span>
		<a href="<?php echo U('Goods/add');?>"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">添加商品</button></a>
	</div>
	
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
			<tr>
				<th colspan="10">
				 	<form action="<?php echo U('Goods/index');?>">
						<input type="text" name="name" />
						<button type="submit">搜索</button>
					</form>
				</th>
			</tr>

			<tr bgcolor="#ccc">
				<th>编号</th>
				<th>商品名</th>
				<th>图片</th>
				<th>价格</th>
				<th>分类</th>
				<th>库存</th>
				<th>上架|下架</th>
				<th>热销|滞销</th>
				<th>新品|旧款</th>
				<th>操作</th>
			</tr>
			<?php if(is_array($list)): foreach($list as $key=>$val): ?><tr>
					<td><?php echo ($val['gid']); ?></td>
					<td><?php echo ($val['gname']); ?></td>
					<td><img src="/Shopping<?php echo ($val['giname']); ?>" alt=""></td>
					<td>￥:<?php echo ($val['gp']); ?></td>
					<td><?php echo ($val['cname']); ?></td>
					<td><?php echo ($val['gs']); ?></td>
					<td width="100px;">
					<?php if($val['gb'] == 1): ?><a href="<?php echo U('Goods/bast',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">上架</button></a>
					<?php else: ?>
					<a href="<?php echo U('Goods/bast',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">下架</button></a><?php endif; ?>
				</td>
				<td width="100px;">
					<?php if($val['ghot'] == 1): ?><a href="<?php echo U('Goods/hot',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">热销</button></a>
					<?php else: ?>
					<a href="<?php echo U('Goods/hot',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">滞销</button></a><?php endif; ?>
				</td>
				<td width="100px;">
					<?php if($val['gnew'] == 1): ?><a href="<?php echo U('Goods/nnew',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">新款</button></a>
					<?php else: ?>
					<a href="<?php echo U('Goods/nnew',['id'=>$val['gid'],'p'=>$p]);?>"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">旧款</button></a><?php endif; ?>
				</td>
					<td><a href="<?php echo U('detail',['id'=>$val['gid'],'p'=>$p]);?>" style="color:#000;display:block">查看详情</a><a href="<?php echo U('Goods/delete',['id'=>$val['gid'],'p'=>$p]);?>" style="color:#000;display:block">删除</a></td>
				</tr><?php endforeach; endif; ?>
			<tr>
				<th colspan="10">
				 	<?php echo ($page); ?>
				</th>
			</tr>
		</table>

		</div>
	</div>
</div>
<div class="clear"></div>
<div id="middle"></div>
<div id="footer">
	<p>Copyright&copy; 2016年 京ICP备11011334号</p>
</div>

</body>
</html>